/*
 Navicat Premium Dump SQL

 Source Server         : AAA-localhost-mysql
 Source Server Type    : MySQL
 Source Server Version : 80040 (8.0.40)
 Source Host           : localhost:3306
 Source Schema         : wmall_user

 Target Server Type    : MySQL
 Target Server Version : 80040 (8.0.40)
 File Encoding         : 65001

 Date: 26/04/2025 00:21:53
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `user_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '用户 ID',
  `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户名',
  `login_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '登录 Id，电话号码/邮箱',
  `user_pwd` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户密码',
  `phone_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '电话号码',
  `email_add` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '邮件地址',
  `user_img` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户头像',
  `user_status` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '用户状态：1 正常，9 屏蔽',
  `valid` bit(1) NOT NULL DEFAULT b'1' COMMENT '是否有效：1 有效，0 无效',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`user_id`) USING BTREE,
  UNIQUE KEY `idx_login_id` (`login_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` (`user_id`, `user_name`, `login_id`, `user_pwd`, `phone_no`, `email_add`, `user_img`, `user_status`, `valid`, `create_time`, `update_time`) VALUES (4, 'user-name-4', 'great@163.com', 'abc123456789', '', '', '', 1, b'1', '2025-04-06 22:17:40', '2025-04-06 22:17:40');
INSERT INTO `user` (`user_id`, `user_name`, `login_id`, `user_pwd`, `phone_no`, `email_add`, `user_img`, `user_status`, `valid`, `create_time`, `update_time`) VALUES (5, 'user-name-5', 'greatwqs@qq.com', '123456789', '', '', '', 1, b'1', '2025-04-06 22:17:55', '2025-04-06 22:17:55');
INSERT INTO `user` (`user_id`, `user_name`, `login_id`, `user_pwd`, `phone_no`, `email_add`, `user_img`, `user_status`, `valid`, `create_time`, `update_time`) VALUES (6, 'user-name-6', 'great@gmail.com', 'abc123456789', '', '', '', 1, b'1', '2025-04-06 22:18:01', '2025-04-06 22:18:01');
INSERT INTO `user` (`user_id`, `user_name`, `login_id`, `user_pwd`, `phone_no`, `email_add`, `user_img`, `user_status`, `valid`, `create_time`, `update_time`) VALUES (7, 'user-name-7', '15802880041', '123456789', '', '', '', 1, b'1', '2025-04-06 22:18:11', '2025-04-06 22:18:11');
INSERT INTO `user` (`user_id`, `user_name`, `login_id`, `user_pwd`, `phone_no`, `email_add`, `user_img`, `user_status`, `valid`, `create_time`, `update_time`) VALUES (8, 'user-name-8', '15281029389', '123456789', '', '', '', 1, b'1', '2025-04-25 23:12:22', '2025-04-25 23:12:22');
COMMIT;

-- ----------------------------
-- Table structure for user_login
-- ----------------------------
DROP TABLE IF EXISTS `user_login`;
CREATE TABLE `user_login` (
  `seq` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL DEFAULT '0',
  `login_token` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `expire_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `valid` bit(1) NOT NULL DEFAULT b'1' COMMENT '是否有效：1 有效，0 无效',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`seq`),
  UNIQUE KEY `unq_idx_login_token` (`login_token`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of user_login
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
